package UI 
{
	/**
	 * ...
	 * @author Bryan Keiren & Sander van Katwijk
	 */
	public class Page 
	{
		private var m_Buttons:Vector.<Button> = new Vector.<Button>();
		
		public function Page() 
		{
			
		}
		
		public function addButton(a_Button:Button):void
		{
			m_Buttons.push(a_Button);
		}
		
		public function getButtons():Vector.<Button>
		{
			return m_Buttons;
		}
		
		public function getButton(a_Name:String):Button
		{
			for (var i:int = 0; i < m_Buttons.length; ++i)
			{
				if (m_Buttons[i].getName() == a_Name)
				{
					return m_Buttons[i];
				}
			}
			return null;
		}
		
		public function popButton():void
		{
			var button:Button = m_Buttons.pop();
			Engine.Get().removeChild(button);
			Engine.Get().removeChild(button.text);
		}
		
		public function disable():void
		{
			for (var i:int = 0; i < m_Buttons.length; ++i)
			{
				m_Buttons[i].disable();
			}
		}
		
		public function enable():void
		{
			for (var i:int = 0; i < m_Buttons.length; ++i)
			{
				m_Buttons[i].enable();
			}
		}		
	}

}